import java.util.Scanner;


public class 进制转换 {
    //十进制转换二进制
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int k = in.nextInt();
        String tem = Integer.toBinaryString(k);
        System.out.println(tem);
    }
    //二进制转换十六进制
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int k = in.nextInt();
        int tem = Integer.parseInt(String.valueOf(k),2);
        String ret = Integer.toHexString(tem).toUpperCase();
        System.out.println(ret);
    }
    //十进制转换八进制和十六进制
    public static void main(String[] args) {
        int a = 1234;
        String tem = Integer.toBinaryString(a);
        int tem1 = Integer.parseInt(tem, 2);
        String rst1 = Integer.toOctalString(tem1);
        String rst2 = Integer.toHexString(tem1).toUpperCase();
        System.out.printf("%s %s\n",rst1,rst2);
        String rst3 = Integer.toOctalString(a);
        System.out.println(rst3);
        String rst4 = Integer.toHexString(a);
        System.out.println(rst4);
    }
}
